<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form id="frmItems">
		<input type="hidden" name="roleId" value="${roleId}" />
		<table class="easyui-datagrid" style="width: fill; height: 300px;"
			data-options="singleSelect:false,iconCls:'icon-table',border:true,nowrap:false,rownumbers:true">
			<thead>
				<tr>
					<th data-options="field:'id',width:40,align:'center',checkbox:true">选择</th>
					<th data-options="field:'code',width:80,align:'center'">权限编码</th>
					<th data-options="field:'name',align:'center'">权限名称</th>
					<th data-options="field:'createDate',width:100,align:'center'">创建日期</th>
					<th data-options="field:'description',align:'center'">描述</th>
				</tr>
			</thead>
			<s:iterator var="entry" value="permissions">
				<tr>
					<td>${entry.id}</td>
					<td>${entry.code}</td>
					<td>${entry.name}</td>
					<td><s:date name="#entry.createDate" format="yyyy-MM-dd" /></td>
					<td>${entry.description }</td>
				</tr>
			</s:iterator>
		</table>
	</form>

	<div style="text-align: center; padding: 5px">
		<a href="javascript:void(0)" class="easyui-linkbutton" onclick="submitForm()">保存</a> <a href="javascript:void(0)"
			class="easyui-linkbutton" onclick="closeWinItem()">关闭</a>
	</div>

	<script type="text/javascript">
		function submitForm() {
			var params = $("#frmItems").serialize();
			$.ajax({
				url : "${path}/system/role/savePermissions.do",
				type : "POST",
				data : params,
				dataType : "json",
				success : function(data) {
					if (null != data.message) {
						$.messager.alert("提示信息", data.message);
					} else {
						$.messager.alert("提示信息", "数据保存成功！");
					}
				}
			});
		}
	</script>
</body>
</html>